<?php echo $this->fetch('member.header.html'); ?>
<script type="text/javascript" src="<?php echo SITE_URL."/includes/libraries/javascript/" . 'abouts_kuaidi.js'; ?>" charset="utf-8"></script>
<style type="text/css">
.information {padding:30px 0 30px 30px;width:830px;overflow: hidden;}
.information .photo {float: left;width: 120px; overflow:hidden}
.information .lcj_btn {display: block; width: 100px;border:1px #F06D10 solid;border-radius:5px;background:#EF6F21;height:30px; line-height:30px;font-weight:normal;margin-top:8px; color:#FFF}
.information .info table {width: 100%; border-collapse: collapse;font-family:"Microsoft Yahei"}
.information .info h1{color:#FF4F01; height:35px; line-height:35px;}
.information .info th{color: #333; text-align:right; font-weight:bold;padding-right:10px; font-size:13px; height: 40px;}
.information .info td{font-size:13px; padding:5px 0;}
.individual {width: 680px; float: left; padding-left: 20px;}
</style>
<div class="content_color">
<div class="content">
<?php echo $this->fetch('member.menu.html'); ?>
<div id="right">
<?php echo $this->fetch('member.submenu.html'); ?>
<div class="wrap">
  <div class="public">
  <form method="post" enctype="multipart/form-data" id="profile_form">
    <div class="information">
    <?php if (! $this->_var['edit_avatar']): ?>
    <div class="photo">
        <p><img src="<?php if ($this->_var['profile']['portrait']): ?><?php echo $this->_var['profile']['portrait']; ?>?<?php echo $this->_var['random_number']; ?><?php else: ?><?php echo $this->_var['site_url']; ?>/<?php echo $this->_var['default_user_portrait']; ?><?php endif; ?>" width="120" id="c_img" /></p>
        <p><input id="btnZM" onclick="javascript:UploadCard('c_input','c_img');" class="lcj_btn" type="button" value="上传头像"/><input name="c_input" type="hidden" id="c_input" /></p>
        <?php endif; ?>
    </div>
    <div class="info individual">
    <table>
        <tr>
            <th width="120" class="width2">用户名: </th>
            <td><?php echo htmlspecialchars($this->_var['profile']['user_name']); ?></td>
        </tr>
        <tr>
            <th width="120">电子邮箱:</th>
            <td><?php echo $this->_var['profile']['email']; ?></td>
        </tr>
        <tr>
            <th width="120">真实姓名:</th>
            <td><input type="text" class="text" name="real_name" value="<?php echo htmlspecialchars($this->_var['profile']['real_name']); ?>" /><label class="field_message"></label></td>
        </tr>
        <tr>
            <th width="120">性别: </th>
            <td class="label">
                <label><input type="radio" name="gender" value="0" <?php if ($this->_var['profile']['gender'] == 0): ?>checked="checked"<?php endif; ?> />保密 </label>&nbsp;&nbsp;
                <label><input type="radio" name="gender" value="1" <?php if ($this->_var['profile']['gender'] == 1): ?>checked="checked"<?php endif; ?> />男 </label>&nbsp;&nbsp;
                <label><input type="radio" name="gender" value="2" <?php if ($this->_var['profile']['gender'] == 2): ?>checked="checked"<?php endif; ?> />女 </label>
            </td>
        </tr>
        <tr>
            <th width="120">手机/电话:</th>
            <td><input type="text"  class="text"name="phone_mob" value="<?php echo htmlspecialchars($this->_var['profile']['phone_mob']); ?>" /><label class="field_message"></label></td>
        </tr>                                
        <tr style="display:none">
            <th width="120">固定电话:</th>
            <td> <input type="text" class="text" name="phone_tel" value="<?php echo htmlspecialchars($this->_var['profile']['phone_tel']); ?>" /><label class="field_message"></label></td>
        </tr>
        <tr>
            <th width="120">QQ号码: </th>
            <td>
                <input type="text" class="text" name="im_qq" id="im_qq" value="<?php echo htmlspecialchars($this->_var['profile']['im_qq']); ?>" /><label class="field_message"></label>
            </td>
        </tr>
        <tr>
            <th width="120">出生日期:</th>
            <td><input type="text" class="text" name="birthday" id="birthday" value="<?php if ($this->_var['profile']['birthday']): ?><?php echo htmlspecialchars($this->_var['profile']['birthday']); ?><?php endif; ?>" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/><label class="field_message"></label>
            </td>
        </tr>
        <tr>
          <th>所在区域:</th>
          <td class="idpic"><input name="idpic" type="radio" id="rbtnyes" value="rbtnyes" <?php if ($this->_var['profile']['idpic'] != 'rbtnno'): ?>checked="checked"<?php endif; ?> /><label for="rbtnyes"> 中国</label>&nbsp;&nbsp;&nbsp;&nbsp;<input id="rbtnno" type="radio" name="idpic" value="rbtnno" <?php if ($this->_var['profile']['idpic'] == 'rbtnno'): ?>checked="checked"<?php endif; ?>/><label for="rbtnno"> 美国</label></td>
          <td>&nbsp;</td>
        </tr>                                        
        <?php if ($this->_var['edit_avatar']): ?>
        <tr>
            <th width="120">头像:</th>
            <td><?php echo $this->_var['edit_avatar']; ?></td>
        </tr>
        <?php endif; ?>
        <tr>
            <th width="120"></th>
            <td><input type="submit" class="submit_btn" value="保存修改" /></td>
        </tr>
    </table>
    </div>
    </div>
  </form>
  </div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
    $('#profile_form').validate({
        errorPlacement: function(error, element){
            var _message_box = $(element).parent().find('.field_message');
            _message_box.find('.field_notice').hide();
            _message_box.append(error);
        },
        success : function(label){
            label.addClass('validate_right').text('OK!');
        },
        onkeyup : false,
        rules : {
            real_name : {required : true},
            phone_mob : {required : true, minlength: 6, checkTel : true},
            im_qq : {minlength: 5,maxlength: 11, digits : true}
        },
        messages : {
            real_name : {required : '请填写真实姓名. '},
            phone_mob : {required : '请填写正确的手机电话号码. ', minlength: '请输入正确的电话号码，最小为6位数字', checkTel: "请输入正确的手机号码或者固定电话"},
			im_qq : {minlength: '请输入正确的QQ号，最小为5位数字', maxlength: '请输入正确的QQ号，最大为11位数字', digits : 'QQ号码必须为数字'}
        }
    });
});

function UploadCard(c_input,c_img){dialog("上传头像","iframe:/data/fullAvatarEditor/upload_idphoto.php?box_height=450&box_width=580&avatar_sizes=250*250&c_input="+c_input+"&c_img="+c_img,"1250","630","");}
</script>
<?php echo $this->fetch('footer_member.html'); ?>